from urllib import parse,request
import time
print (time.strftime("%Y%m%d"))
print (time.strftime("%H:%M:%S"))
theday = time.strftime("%Y%m%d")
thetime = time.strftime("%H:%M:%S")
# text = '今日课程签到'+thetoday
text = '%s%s%s%s' % ('今日课程签到 ',theday ,'-' ,thetime)
desp = text
textmod={'text':text,'desp':desp}
textmod = parse.urlencode(textmod)
# print(textmod)

header_dict = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko'}
url='https://sc.ftqq.com/SCU25534T73721601f11607ca3179886cff4641165ae426e41da3e.send'
req = request.Request(url='%s%s%s' % (url,'?',textmod),headers=header_dict)
res = request.urlopen(req)
res = res.read()
# print(res)
#输出内容(python3默认获取到的是16进制'bytes'类型数据 Unicode编码，如果如需可读输出则需decode解码成对应编码):b'\xe7\x99\xbb\xe5\xbd\x95\xe6\x88\x90\xe5\x8a\x9f'
# print(res.decode(encoding='utf-8'))
print(res.decode(encoding='utf-8'))